package com.itheima.service.impl;

import com.itheima.domain.Article;
import com.itheima.mapper.ArticleMapper;
import com.itheima.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Name ArticleServiceImpl
 * @Author BaiXin
 * @Date 2022-10-17 10:51
 */
@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public List<Article> findByHeat() {
        List<Article> articleList = articleMapper.findByHeat();
        return articleList;
    }

    @Override
    public void add(Article article) {
        articleMapper.add(article);
    }

    @Override
    public void deleteById(Integer id) {
        articleMapper.deleteById(id);
    }
}
